package com.lktx.sso.admin.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import lombok.Data;

import java.time.LocalDateTime;

/** app应用访问控制 - sso_app_access_policy */
@Data
@Table("sso_app_access_policy")
public class SsoAppAccessPolicy {

    /**主键*/
    @Id(value = "sso_access_policy_id", keyType = KeyType.Auto)
    private Integer ssoAccessPolicyId;
    /** 应用ID*/
    private Integer ssoAppId;
    /**主体ID（用户、分组、组织机构）*/
    private Integer subjectId;
    /**主体类型（用户、分组、组织机构）*/
    private SubjectType subjectType;
    /**启用*/
    private Boolean enabled;
    /**创建时间*/
    @Column(onInsertValue = "now()")
    private LocalDateTime createTime;
    /**更新时间*/
    @Column(onUpdateValue = "now()", onInsertValue = "now()")
    private LocalDateTime updateTime;

    @Column(ignore = true)
    private Object subObj;

    public enum SubjectType{
        USER,USER_GROUP,ORGANIZATION
    }

}